#include "logo.h"

void save(void)
{
     FILE *f;
     int i;
     int j;
     char *name;
     char nameStr[MAXVALUE];
     
     name =nameStr;
     strcpy(name,getValue());
     if ((f =fopen(name,"w+")) == NULL)
     {
        printf("CAN'T OPEN FILE\n");
        return ;
     }
     fprintf(f,"%d\n",wordLen);
     for (i=0;i<wordLen;i++)
     {
         fputs(wordName[i],f);
         fputs("\n",f);
         fputs(wordValue[i],f);
         fputs("\n",f);
     }
     fprintf(f,"%d\n",toLen);
     for (i=0;i<toLen;i++)
     {
         fputs(toName[i][0],f);
         fputs("\n",f);
         fprintf(f,"%d\n",toPar[i]);
         fputs(toValue[i][0],f);
         fputs("\n",f);
         for (j=1;j<=toPar[i];j++)
         {
             fputs(toName[i][j],f);
             fputs("\n",f);
         }
     }
     fclose(f);
     return ;
}
